The present invention relates to a digital frequency detecting apparatus and method and relates particularly, though not exclusively, to a precise digital frequency detection system for detecting small frequency differences between a signal square wave and a reference waveform.
Many methods have been described to measure the frequency of a square wave signal. For the purposes of this document, these methods can be divided into three classes:
(a) Digital methods
(b) Analog methods
(c) Mixed methods employing analog to digital converters with some analog processing of the square wave (for example filtering to convert it to a sine wave).
The prior art digital methods can only detect large phase changes between the signal and reference (typically a whole clock cycle) or they require clock rates much higher than the signal frequency to measure small phase changes. As they need to measure accurately the period of every signal clock cycle, this greatly limits their application. Some methods employ delay line time digitisers to accurately measure the period of every signal clock cycle without resorting to high clock rates. Unfortunately these methods require delay elements with very small and accurate delays, which again limits their application to high signal frequencies. Furthermore, they are only economical when access to custom analog integrated circuit technology is available.
The analog methods are able to detect small phase changes between the signal and reference. Some examples are the quadricorrelator, and classic FM discriminators involving differentiation of the signal by use of tuned filters or time delays. These methods have the usual analog disadvantages of being hard to integrate and requiring precision components and/or tuning when manufactured.
Some examples of mixed analog digital methods are, heterodyning the signal to a much lower frequency whose period can be accurately measured digitally. Converting the square wave to a sine wave by low pass filtering then digitising the waveform using analog to digital converters. There is a significant amount of literature on using the samples to determine the frequency of the signal. These methods require at least some analog processing of the square wave and also an analog to digital converter.
The present invention was developed with a view to providing a digital frequency detecting apparatus and method that can detect arbitrarily small phase changes between the signal and reference waveforms and that can be implemented with off-the-shelf digital components
According to one aspect of the present invention there is provided a digital frequency detecting apparatus for detecting small frequency differences between a signal waveform and a reference waveform, the apparatus comprising:
means for digitally generating reference slip events effectively indicative of phase slips between the reference waveform and a sampling clock signal;
means for digitally generating signal slip events effectively indicative of phase slips between the signal waveform and the sampling clock signal;
means for digitally combining the reference slip events with the signal slip events to produce a digital output indicative of phase slips between the reference waveform and the signal waveform whereby, in use, the magnitude of a frequency difference between the signal and the reference waveforms can be determined from the number of phase slips per unit time.
In a preferred embodiment said means for generating reference slip events comprises an array of simple digital frequency detectors, each simple frequency detector only being capable of detecting a large phase slip between the reference waveform and the sampling clock signal, and each simple frequency detector in the array having a different starting phase with respect to the reference waveform.
Alternatively said means for generating reference slip events comprises a digital logic circuit designed to generate a stream of slip events as if there were a reference waveform present.
Preferably said means for generating signal slip events comprises an array of simple digital frequency detectors, each simple frequency detector only being capable of detecting a large phase slip between the signal waveform and the sampling clock signal, and each simple frequency detector in the array having a different starting phase with respect to the signal waveform.
Typically said combining means effectively subtracts the stream of reference slip events from the stream of signal slip events to produce an output indicative of phase slips between the reference waveform and the signal waveform.
In one embodiment each of said simple frequency detectors comprises a memory element for storing a previous sample and an Exclusive OR gate with inversion to determine if a slip event has occurred. Typically the memory elements in each simple frequency detector are flip flops clocked at predetermined periods with phased clock signals generated by a phased clock generation means. In an alternative embodiment a single Exclusive OR gate with inversion is shared between all the simple frequency detectors and the memory elements are implemented with a shift register.
According to another aspect of the present invention there is provided a digital frequency detecting method for detecting small frequency differences between a signal waveform and a reference waveform, the method comprising:
digitally generating reference slip events effectively indicative of phase slips between the reference waveform and a sampling clock signal;
digitally generating signal slip events effectively indicative of phase slips between the signal waveform and the sampling clock signal; and,
digitally combining the reference slip events with the signal slip events to produce a digital output indicative of phase slips between the reference waveform and the signal waveform whereby, in use, the magnitude of a frequency difference between the signal and reference waveforms can be determined from the number of phase slips per unit time.
In a preferred embodiment said step of digitally generating reference slip events is effected using an array of simple digital frequency detectors, each simple frequency detector only being capable of detecting a large phase slip between the reference waveform and the sampling clock signal, and each simple frequency detector in the array having a different starting phase with respect to the reference waveform.
Alternatively said step of digitally generating reference slip events involves the digital generation of slip events, as if there were a reference waveform present.
Preferably said step of digitally generating signal slip events is effected using an array of simple digital frequency detectors, each simple frequency detector only being capable of detecting a large phase slip between the signal waveform and the sampling clock signal, and each simple frequency detector in the array having a different starting phase with respect to the signal waveform.
Typically said step of digitally combining involves effectively subtracting the stream of reference slip events from the stream of signal slip events to produce an output indicative of phase slips between the reference waveform and the signal waveform.
Although the following description will be given primarily with reference to the detection of small frequency differences between a signal square wave and a reference waveform, it is to be understood that the digital frequency detecting apparatus and method according to the invention can also be used with other signal waveforms and is not limited to square waves.